%%%-------------------------------------------------------------------
%%% @author Rain
%%% @doc 日志相关
%%% @end
%%%-------------------------------------------------------------------

-ifndef(LOG_HRL).
-define(LOG_HRL, true).


-include_lib("eunit/include/eunit.hrl").
-author("Rain").

%% kernel/include/logger_internal.hrl
%%-define(LEVELS,[none,
%%    emergency,
%%    alert,
%%    critical,
%%    error,
%%    warning,
%%    notice,
%%    info,
%%    debug,
%%    all]).

-define(LOG_MOD, logger).

-define(LOG_META(LogLevelShow),
    #{log_lv_show => LogLevelShow,
        mod => ?MODULE,
        func => ?FUNCTION_NAME,
        line => ?LINE}).

-define(LOG_DEBUG(Format), ?LOG_MOD:log(debug, Format, [], ?LOG_META("[DEBUG]"))).
-define(LOG_DEBUG(Format, Args), ?LOG_MOD:log(debug, Format, Args, ?LOG_META("[DEBUG]"))).

-define(LOG_INFO(Format), ?LOG_MOD:log(info, Format, [], ?LOG_META("[INFO]"))).
-define(LOG_INFO(Format, Args), ?LOG_MOD:log(info, Format, Args, ?LOG_META("[INFO]"))).

-define(LOG_WARN(Format), ?LOG_MOD:log(warning, Format, [], ?LOG_META("[WARN]"))).
-define(LOG_WARN(Format, Args), ?LOG_MOD:log(warning, Format, Args, ?LOG_META("[WARN]"))).

-define(LOG_ERROR(Format), ?LOG_MOD:log(error, Format, [], ?LOG_META("[ERROR]"))).
-define(LOG_ERROR(Format, Args), ?LOG_MOD:log(error, Format, Args, ?LOG_META("[ERROR]"))).

-define(LOG_PATH, game_log_config:get(log_path)).


%%-include_lib("kernel/src/logger_internal.hrl").
-define(DEFAULT_HANDLER_FILTERS(Domain),
    [{remote_gl,{fun logger_filters:remote_gl/2,stop}},
        {domain,{fun logger_filters:domain/2,{stop,sub,Domain}}},
        {no_domain,{fun logger_filters:domain/2,{log,undefined,[]}}}]).

-endif.